package com.woniu.market_stall.mapper;

import com.woniu.market_stall.entity.User;
import com.woniu.market_stall.vo.UserVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    User selectByPrimaryKey(Integer id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);


    List<UserVo> selectManagerByName(String name);


    @Update("UPDATE p_user SET is_delete = 1 WHERE id =#{id};")
    int delByPrimaryKey(Long id);
    

    void insertUser(UserVo userVo);

    void updateUser(User u);

    User queryPerByKey(Integer id);

    List<UserVo> selectUserByName(String name);

    @Select("SELECT * FROM p_user WHERE is_delete = 0")
    List<UserVo> selectShowAllUser();
}